/**
 * @description 定义路由
 */

import Welcome from "../pages/login/index.vue";

const Register = () => import("../pages/login/register.vue");
const Login = () => import("../pages/login/login.vue");
const Tabbar = () => import("../pages/tabbar/index.vue");
const Home = () => import("../pages/home/index.vue");
const Category = () => import("../pages/category/index.vue");
const Bags = () => import("../pages/bags/index.vue");

const Mine = () => import("../pages/mine/index.vue");
const Details = () => import("../pages/details/index.vue");
const Search = () => import("../pages/search/index.vue");
const Bagscart = () => import("../pages/bags/index.vue");
const Address = () => import("../pages/address/index.vue");
const Information = () => import("../pages/mine/information.vue");

const routes = [
  { path: "/", component: Welcome, meta: { nologin: true } },
  { path: "/login", component: Login, meta: { nologin: true } },
  { path: "/register", component: Register, meta: { nologin: true } },
  { path: "/search", component: Search },
  // { path: "/bagscarts", component: Bagscart, meta: { nologin: true } },
  {
    path: "/tabbar",
    name: "tabbar",
    component: Tabbar,
    redirect: "home",
    children: [
      {
        path: "/home",
        name: "home",
        component: Home,
      },
      {
        path: "/category",
        name: "category",
        component: Category,
      },
      {
        path: "/bags",
        name: "bags",
        component: Bags,
      },
      {
        path: "/mine",
        name: "mine",
        component: Mine,
      },
    ],
  },
  { path: "/details", component: Details },
  { path: "/address", component: Address},
  { path: "/information", component: Information}
];

export default routes;
